const path = require('path');
const WMerge = require('webpack-merge');
const baseConfig = require('./webpack.base.conf.js');
const webpack = require('webpack');

module.exports = WMerge.merge(baseConfig, {
  output: {
    publicPath: '/',
    libraryTarget:"umd",
  },
  devServer: {
    historyApiFallback: true,
    contentBase: path.join(__dirname, '.'),
    hot: true,
    inline: true,
    progress: true,
    host: '0.0.0.0',
    disableHostCheck: true,
    proxy: {
      // '/gateway': {
      //     target: 'http://office.biying.net.cn:18080',
      //     changeOrigin: true,
      //     secure: false
      // },
      // '/profile': {
      //     target: 'http://office.biying.net.cn:18080',
      //     changeOrigin: true,
      //     secure: false
      // },
      '/gateway': {
          target: 'http://121.199.167.4',
          changeOrigin: true,
          secure: false
      },
      '/profile': {
          target: 'http://121.199.167.4',
          changeOrigin: true,
          secure: false
      },
    },
  },
  plugins: [
    new webpack.DefinePlugin({
      PRODUCTION: JSON.stringify(false),
      DEVELOPMENT: JSON.stringify(true),
      TESTING: JSON.stringify(false),
    }),
  ],
  devtool: 'cheap-module-eval-source-map',
});
